using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.DirectX.DirectInput;
using Zsa.Emulation.Input;
using System.Windows.Forms;

namespace Zsa.Emulation.Render.Input.Win32
{
    public class KeyboardInputCapabilities : ControllerDeviceCapabilities
    {

        #region Constructor
        /// <summary>
        /// Initializes a new instance of the <see cref="T:DxInputCapabilities"/> class.
        /// </summary>
        public KeyboardInputCapabilities()
            : base ( 1)
        {
        }
        #endregion Constructor

        #region Properties
        /// <summary>
        /// Gets the default device.
        /// </summary>
        /// <value></value>
        public override RenderDeviceItem DefaultDevice
        {
            get
            {
                return new RenderDeviceItem("Keyboard", "Keyboard", RenderDeviceType.Input, 0);
            }
        }
        #endregion Properties

        #region Methods
        /// <summary>
        /// Creates the settings for the item.
        /// </summary>
        /// <param name="item"></param>
        /// <returns></returns>
        public override ControllerSettings CreateSettings(RenderDeviceItem item)
        {
            KeyboardInputSettings _KeyboardSettings = new KeyboardInputSettings(item);
            _KeyboardSettings.SetKey(NesInputButton.A, 0, Keys.Z);
            _KeyboardSettings.SetKey(NesInputButton.B, 0, Keys.X);
            _KeyboardSettings.SetKey(NesInputButton.Start, 0, Keys.A);
            _KeyboardSettings.SetKey(NesInputButton.Select, 0, Keys.S);

            _KeyboardSettings.SetKey(NesInputButton.Up, 0, Keys.Up);
            _KeyboardSettings.SetKey(NesInputButton.Down, 0, Keys.Down);
            _KeyboardSettings.SetKey(NesInputButton.Left, 0, Keys.Left);
            _KeyboardSettings.SetKey(NesInputButton.Right, 0, Keys.Right);
            return _KeyboardSettings;
        }

        /// <summary>
        /// Gets the devices supported by the render.
        /// </summary>
        /// <returns></returns>
        public override IList<RenderDeviceItem> GetDevices()
        {
            return new RenderDeviceItem[0];
        }
        #endregion Methods
    }
}
